home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / VISCAFE.BIN / VPOJAVA.DLL / SOURCE / PASSWORD_DIALOG < prev    next >
Encoding:
Text File  |  1997-06-19  |  1.7 KB  |  76 lines

  1. import java.awt.*;
  2. import symantec.itools.awt.util.dialog.ModalDialog;
  3.  
  4. public class PasswordDialog extends ModalDialog {
  5.     
  6.     public PasswordDialog(Frame parent, String title)
  7.     {
  8.         super(parent, title);
  9.         
  10.         //{{INIT_CONTROLS
  11.         setLayout(null);
  12.         // addNotify();
  13.         resize(215, 130);
  14.     
  15.         nameLabel = new Label("Name:");
  16.         nameLabel.reshape(10, 32, 75, 15);
  17.         add(nameLabel);
  18.         
  19.         passwordLabel = new Label("Password:");
  20.         passwordLabel.reshape(10, 60, 75, 15);
  21.         add(passwordLabel);
  22.     
  23.         userTextField = new TextField(1);
  24.         userTextField.reshape(85, 28, 100, 22);
  25.         add(userTextField);
  26.     
  27.         passTextField = new TextField(1);
  28.         passTextField.setEchoCharacter('*');
  29.         passTextField.reshape(85, 57, 100, 22);
  30.         add(passTextField);
  31.     
  32.         okButton = new Button("OK");
  33.         okButton.reshape(80, 95, 40, 20);
  34.         add(okButton);
  35.         //}}
  36.     }
  37.     
  38.     public PasswordDialog(Frame parent) {
  39.         this(parent, "Username/Password");
  40.     }
  41.     
  42.     // Add a constructor for Interactions (ignoring modal)
  43.     public PasswordDialog(Frame parent, boolean modal) {
  44.         this(parent);
  45.     }
  46.     
  47.     // Add a constructor for Interactions (ignoring modal)
  48.     public PasswordDialog(Frame parent, String title, boolean modal) {
  49.         this(parent, title);
  50.     }
  51.     
  52.     public String getUserName() {
  53.         return userTextField.getText();
  54.     }
  55.     
  56.     public String getPassword() {
  57.         return passTextField.getText();
  58.     }
  59.     
  60.     public void setUserName(String name) {
  61.         userTextField.setText(name);
  62.     }
  63.     
  64.     public void setPassword(String pass) {
  65.         passTextField.setText(pass);
  66.     }
  67.     
  68.     //{{DECLARE_CONTROLS
  69.     java.awt.Label nameLabel;
  70.     java.awt.Label passwordLabel;
  71.     java.awt.TextField userTextField;
  72.     java.awt.TextField passTextField;
  73.     java.awt.Button okButton;
  74.     //}}
  75. }
  76.